# -*- mode: org; -*-
#+TITLE: Erlang Shell Usage
#+AUTHOR: Zelphir Kaltstahl
#+EMAIL: zelphirkaltstahl@posteo.de
#+STARTUP: content indent align inlineimages hideblocks entitiesplain nologdone nologreschedule nologredeadline nologrefile
#+TODO: TODO WIP DEPRECATED | DONE
#+DATE: <2021-06-21 Mon>
#+KEYWORDS: erlang shell usage guide
#+LANGUAGE: English
#+PRIORITIES: A E E
#+EXCLUDE_TAGS: noexport
#+OPTIONS: ^:{}
#+OPTIONS: H:10
#+OPTIONS: toc:2
#+OPTIONS: tags:nil
#+OPTIONS: tasks:t
#+OPTIONS: H:6
#+OPTIONS: p:nil
#+OPTIONS: pri:nil
#+OPTIONS: prop:nil
#+OPTIONS: todo:t
#+OPTIONS: stat:nil
#+OPTIONS: |:t
#+OPTIONS: inline:nil
#+OPTIONS: date:t

* Starting

#+begin_src shell
erl
#+end_src

* Starting and adding directory to load path

#+begin_src shell
erl -pa DIRECTORY
#+end_src

* Start Nitrogen shell

#+begin_src shell
bin/nitrogen console
#+end_src

* Start watching for file changes

#+begin_src erlang
sync:go().
#+end_src

* Exiting

There are multiple ways of exiting the Erlang shell.

** quit procedure

This will tell the Erlang runtime to stop everything it is doing. Not suitable for a supposed to continue running cluster.

#+begin_src erlang
q().
#+end_src

** key combination (abort)

=C-c C-c a=

** key combination (quit)

=C-c C-c q RET=

** key combination (soft quit)

This will merely leave the shell, keeping the Erlang runtime going.

=C-g q RET=

* Reading all records of a module

#+begin_src erlang
rr(module_name).
#+end_src

* List record definitions

#+begin_src erlang
rr(module_name).
#+end_src

* Current working directory

#+begin_src erlang
pwd().
#+end_src

* local variable definitions                                       :noexport:

# Local Variables:
# fill-column: 80
# org-babel-noweb-wrap-start: "<<"
# org-babel-noweb-wrap-end: ">>"
# org-confirm-babel-evaluate: nil
# End:
